import type { TOrder } from '@/types/consult'
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useConsultStore = defineStore(
  'consult',
  () => {
    const consultOrder = ref<TOrder>()
    const setConsultOrder = (val: TOrder) => {
      consultOrder.value = val
    }
    const setPatientId = (id: string) => {
      consultOrder.value!.patientId = id
    }

    return { consultOrder, setConsultOrder, setPatientId }
  },
  {
    persist: {
      paths: ['consultOrder']
    }
  }
)
